public class Solution {
    public boolean isAnagram(String s, String t) {
        String[] ss = s.split("");
        String[] tt = t.split("");
        Collections.sort(Arrays.asList(ss));
        Collections.sort(Arrays.asList(tt));
        return Arrays.equals(ss, tt);
    }
}